import request from '@/utils/request'

// 查询订单管理列表
export function listOrder(query) {
  return request({
    url: '/admin/SOrder/orderList',
    method: 'get',
    params: query
  })
}

// 查询订单管理详细
export function getOrder(orderId) {
  return request({
    url: '/admin/SOrder/orderDetails/order/' + orderId,
    method: 'get'
  })
}

// 新增订单管理
export function addOrder(data) {
  return request({
    url: '/admin/SOrder/orderAdd',
    method: 'post',
    data: data
  })
}

// 修改订单管理
export function updateOrder(data) {
  return request({
    url: '/system/order',
    method: 'put',
    data: data
  })
}

// 删除订单管理
export function delOrder(orderId) {
  return request({
    url: '/admin/SOrder/orderDel/order/' + orderId,
    method: 'delete'
  })
}

// 立即付款订单
export function PayOrder(orderId){
  return request({
    url: '/admin/SOrder/PayOrder/order/' + orderId,
    method: 'get'
  })
}

//已收货订单
export function receiveOrder(orderId){
  return request({
    url: '/admin/SOrder/receiveOrder/order/' + orderId,
    method: 'get'
  })
}

// 立即退款订单
export function refundOrder(data){
  return request({
    url: '/admin/SOrder/refundOrder',
    method: 'post',
    data: data
  })
}

// 核销订单
export function sellOrder(verifyCode) {
  return request({
    url: '/admin/SOrder/sellOrder/verifyCode/' + verifyCode,
    method: 'get'
  })
}

// 修改订单
export function saveOrder(orderId,payPrice){
  const data = {
    orderId,
    payPrice,
  }
  return request({
    url: '/admin/SOrder/saveOrder',
    method: 'post',
    data: data
  })
}

//修改订单备注
export function saveOrderRemark(orderId,remark){
  const data = {
    orderId,
    remark,
  }
  return request({
    url: '/admin/SOrder/saveOrder',
    method: 'post',
    data: data
  })
}
